import Vue from 'vue'
import VueRouter from 'vue-router'
// import Index from '@/views/Index.vue'
import HomeView from '@/views/HomeView.vue'
import LoginView from '@/views/LoginView.vue'
import LifeCycle from '@/views/LifeCycle.vue'
import VBindView from '@/views/VBindView.vue'
import IndexView from '@/views/IndexView.vue'
import VOn from '@/views/VOn.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component:HomeView,
    redirect: "/loginview"
  },
  {
    path: '/loginview',
    name: 'LoginView',
    component: LoginView
    
  },

  {
    path: '/index',
    name: 'Index',
    component: IndexView,
    children:[
      {
        path:'lifecycle',
        component:LifeCycle
      },
      {
        path:'vbind',
        component:VBindView
      },
      {
        path:'von',
        component:VOn
      },
      {
        path: '/about',
        name: 'about',
        component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
      }
    ]
  },
  // {
  //   path: '/lifecycle',
  //   name: 'LifeCycle',
  //   component: LifeCycle
    
  // },
  // {
  //   path: '/vbind',
  //   name: 'VBind',
  //   component:VBindView
    
  // },
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
